package com.ruoyi.car.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.car.mapper.CarLoanMapper;
import com.ruoyi.car.domain.CarLoan;
import com.ruoyi.car.service.ICarLoanService;

/**
 * 贷款配置Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-04-07
 */
@Service
public class CarLoanServiceImpl implements ICarLoanService 
{
    @Autowired
    private CarLoanMapper carLoanMapper;

    /**
     * 查询贷款配置
     * 
     * @param id 贷款配置主键
     * @return 贷款配置
     */
    @Override
    public CarLoan selectCarLoanById(Long id)
    {
        return carLoanMapper.selectCarLoanById(id);
    }

    /**
     * 查询贷款配置列表
     * 
     * @param carLoan 贷款配置
     * @return 贷款配置
     */
    @Override
    public List<CarLoan> selectCarLoanList(CarLoan carLoan)
    {
        return carLoanMapper.selectCarLoanList(carLoan);
    }

    /**
     * 新增贷款配置
     * 
     * @param carLoan 贷款配置
     * @return 结果
     */
    @Override
    public int insertCarLoan(CarLoan carLoan)
    {
        carLoan.setCreateTime(DateUtils.getNowDate());
        return carLoanMapper.insertCarLoan(carLoan);
    }

    /**
     * 修改贷款配置
     * 
     * @param carLoan 贷款配置
     * @return 结果
     */
    @Override
    public int updateCarLoan(CarLoan carLoan)
    {
        carLoan.setUpdateTime(DateUtils.getNowDate());
        return carLoanMapper.updateCarLoan(carLoan);
    }

    /**
     * 批量删除贷款配置
     * 
     * @param ids 需要删除的贷款配置主键
     * @return 结果
     */
    @Override
    public int deleteCarLoanByIds(Long[] ids)
    {
        return carLoanMapper.deleteCarLoanByIds(ids);
    }

    /**
     * 删除贷款配置信息
     * 
     * @param id 贷款配置主键
     * @return 结果
     */
    @Override
    public int deleteCarLoanById(Long id)
    {
        return carLoanMapper.deleteCarLoanById(id);
    }
}
